***************************************
*          @@  FLEX 3 @@              *                  
*                                     *
*   ------ >> Chapitre 18 << ------   *
*                                     *
***************************************


<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

<mx:Script>
	    <![CDATA[
	
	        import mx.controls.Alert;
	        public function afficherMessage():void
	        {
	            Alert.show("Message dinformation");
	        }
	    ]]>
</mx:Script>

	<mx:Button x="10" y="10" label="Afficher" id="btn_afficherMessage" click="afficherMessage()"/>
	
</mx:Application>
	package com.composants
	{
		public class ClMaClasse
		{
		
			
			public function ClMaClasse()
			{
				
			}
			
			//Methode de destruction
			public function detruitre():void{
				delete this;
			}
	
		}
	}
	
	
	//Exemple d'utilisation dans un fichier actionscript :
	
		import com.composants.ClMaClasse
		
	    //Intanciation de la classe
		public var monObjet:ClMaClasse  = new ClMaClasse();
		
		//Destruction de l'objet
1.		monObjet.detruitre();
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"

creationComplete="callLater(afficherTempsInitialisation)">

<mx:Script>
    <![CDATA[
        import flash.utils.Timer;

         [Bindable]
        public var tempsInitialisation:String;

        private function afficherTempsInitialisation():void {
        tempsInitialisation = "Temps d'initialisation: " + getTimer() + " ms";
        }
    ]]>
</mx:Script>

<!--  Affichage du temps dinitialisation -->
<mx:Label id="l1" text="{tempsInitialisation}"/>
</mx:Application>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="afficherMemoire()">

<mx:Script>
    <![CDATA[

         [Bindable]
        public var memoireOccupee:String;

        private function afficherMemoire():void {
        memoireOccupee= "Mmoire occupe : " + flash.system.System.totalMemory + " octets";
        }
    ]]>
</mx:Script>

<!--  Affichage de la taille mmoire occupe -->
<mx:Label id="l1" text="{memoireOccupee}"/>
</mx:Application>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" scriptTimeLimit="120">
</mx:Application>
<!--  Ne pas utiliser le cache -->
<meta http-equiv=pragma content=no-cache>
<!--  Forcer la date dexpiration pour recharger la page --<meta http-equiv=EXPIRES content= Mon, 22 Jul 2000 11:12:01 GMT 
mxmlc -debug=false Application.mxml
mxmlc -strict=true Application.mxml
TraceOutputFileEnable = 0
